package day11;

public class AccountManager {

	private Integer salary;
	
	public AccountManager(Integer salary) {
		this.salary = salary;
	}
	
	// 取钱
	// throws MeiQianException 代表这个方法可能会抛出这个异常
	public void withdraw(Integer money) throws MeiQianException {
		if (salary >= money) {
			salary -= money;
		} else {
			// new了一个异常之后抛出
			throw new MeiQianException("您的余额不足");
		}
	}
}
